﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VSA.Interfaces.Entities;
using VSA.DataAccess;
using VSA.CommonLibrary;

namespace VSA.Entities
{
    public class EntitiesBase : IEntitiesBase<VSADataContext>
    {
        private VSADataContext db;
        public VSADataContext DataContext 
        {
            get
            {
                return db;
            }
            set
            {
                this.db = value;
            }
        }

        private int _NumberOfItems;
        public int NumberOfItems 
        {
            get
            {
                return _NumberOfItems;
            }
            set
            {
                this._NumberOfItems = value;
            }
        }

        private int _NumberOfPages;
        public int NumberOfPages 
        {
            get
            {
                return _NumberOfPages;
            }
            set
            {
                this._NumberOfPages = value;
            }
        }

        private int _NumberOfItemsPerPage = 10;
        public int NumberOfItemsPerPage
        {
            get
            {
                return _NumberOfItemsPerPage;
            }
            set
            {
                this._NumberOfItemsPerPage = value;
            }
        }

        public int GetNumberOfPage()
        {
            return CommonFunction.GetNumberOfPage(this.NumberOfItems, this.NumberOfItemsPerPage);
        }
    }
}
